-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(web): ENG-503 wire up the func editor to the router #1238
feat(web): ENG-503 wire up the func editor to the router #1238
Conversation
👷 Deploy request for system-init-corp pending review.A Netlify team Owner will need to approve the deploy before you can run your build. Are you a team Owner? Visit the deploys page to approve it → Need more help? Learn more in the Netlify docs →
|
6c63b3c
to
b7068db
Compare
@@ -19,8 +19,8 @@ | |||
class="grow overflow-x-hidden overflow-y-hidden dark:bg-neutral-800 dark:text-white text-lg font-semi-bold px-2 pt-2 flex flex-col" | |||
> | |||
<FuncEditorTabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be a little annoying, but if you can set this up to use RouterLink
components (from vue-router) then it will enable right click to open in a new tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah that's a good call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't make that happen until this tailwindlabs/headlessui#1680 fix gets bundled into a release for headless UI (or we could pull headless ui directly from github instead of the npm package). It's the source of a few glitches in the app currently that I was very confused about until I realized that the tab group is not in fact acting as a controlled component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah shoot. Headless ui is pretty neat and useful in some places, but definitely causes some problems in others… might want to ditch it for tabs in favor of something we build.
bors r+ |
bors r- |
Canceled. |
@@ -64,9 +65,25 @@ import { visibility$ } from "@/observable/visibility"; | |||
import { saveFuncToBackend$ } from "@/observable/func"; | |||
import { clearFuncs } from "../FuncEditor/func_state"; | |||
|
|||
const props = defineProps<{ funcId?: string }>(); | |||
|
|||
const selectedFuncId = computed(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more thing - in the past I've set up a router hook/guard to automatically cast the props numbers where appropriate. Just removes some annoying code on routes where we are using it...
router.beforeEach(async (to, from, next) => {
// automatically cast any integer params into proper integers
// so that components can set params to expect a Number
// NOTE - this is so that when we user router link or programatically navigate
// that we can set the param as an int
if (to.params) {
const castNumericParams = _.mapValues(to.params, (val) => {
if (parseInt(val).toString() === val) return parseInt(val);
return val;
});
if (_.isEqual(castNumericParams, to.params)) return next();
return next({
...to,
params: castNumericParams,
});
}
return next();
});
b7068db
to
5c86fa2
Compare
bors r+ |
Build succeeded: |
Appending a func id to the workspace lab route will open the func by that id. Func selection is now driven by route pushes.